<style>    
    #testFileInput2{
        height: 30px; width: 102px; margin-left: 128px;
    }
    #preview1, #topPhpto
        {  
            width:150px;  
            padding-left: 65px;padding-top: 15px; border-top-width: 5px;
            //height:150px;  
        }
</style>
<div class="pageContent">	
    <form method="post" action="__CONTROLLER__/edit?callbackType=closeCurrent" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
        <input type="hidden"  id='hidden'  name='id' value="<{$vo.id}>"/>
        <input type="hidden" name='_sign'  value='<{$_sign}>'/>
        <eq name="vo['id']" value=''>
            <input type='hidden' name='assign_user_id' value="<{$Think.session.authId}>"/>
        </eq>
        <if condition="($_sign eq 1) or ($_sign eq 3)">
            <input type="hidden" name="db" value="Reply"/>
            <div class="pageFormContent" layoutH="58">
                <div class="unit" id='clubs'>
                    <label>活动：</label>
                    <select style="width: 150px;" name="club_id"  <neq name="vo['id']" value=''>readonly</neq>>
                        <foreach name="clubList" item='cList'>
                            <option value="<{$cList['id']}>" <if condition="$cList['id'] eq $vo['club_id']">selected</if>><{$cList.theme}></option>
                        </foreach>
                    </select>
                </div>
                <div class="unit">
                    <label>回复内容：</label>
                    <textarea name="content" rows="5" cols="37" style="resize:none" class="required"><{$vo.content}></textarea>
                </div>
            </div>
        <elseif condition="$_sign eq 2"/>
            <input type="hidden" name="db" value="Reply"/>
            <input type="hidden"  name='id' value=""/>
            <input type="hidden"  name='pre_id' value="<{$vo.id}>"/>
            <input type="hidden" name="assign_user_id" value="<{$Think.session.authId}>"/>
            <div class="pageFormContent" layoutH="58">
                <div class="unit" id='clubs'>
                    <label>活动：</label>
                    <select style="width: 150px;" name="club_id"  <neq name="vo['id']" value=''>readonly</neq>>
                        <foreach name="clubList" item='cList'>
                            <option value="<{$cList['id']}>" <if condition="$cList['id'] eq $vo['club_id']">selected</if>><{$cList.theme}></option>
                        </foreach>
                    </select>
                </div>
                <div class="unit">
                    <label>评论内容：</label>
                    <textarea rows="3" cols="37" style="resize:none" class="" disabled="disabled"><{$vo.content}></textarea>
                </div>
                <div class="unit">
                    <label>回复：</label>
                    <textarea name="content" rows="5" cols="37" style="resize:none" class="required"></textarea>
                </div>
                <div class="unit">
                    <label>接收人：</label>
                    <input type="text" size="25"  value="<{$vo.assign_user_id|getUsername}>" readonly/>
                    <input type="hidden" name="accept_user_id" size="25"  value="<{$vo.assign_user_id}>" readonly/>
                </div>
            </div>
        <elseif condition="$_sign eq 4"/>
            <input type="hidden" name="logo" value="<{$vo.logo}>" id="image">
            <input type="hidden" name="db" value="ClubGroup"/>
            <div class="pageFormContent" layoutH="58">
                <div class="unit">
                    <label>俱乐部名称：</label>
                    <input type="text" name="name" size="25"  value="<{$vo.name}>" class='required' />
                </div>
                <div class="unit">
                    <label>俱乐部英文名：</label>
                    <input type="text" name="en_name" size="25"  value="<{$vo.en_name}>" class='required' />
                </div>
                <div id="preview1" href="">
                    <img src="<{$Think.const.PUBLIC_URL}>Upload/<{$vo.image}>" id='topPhpto'/>               
                </div>
                <div class="unit">
                    <label>LOGO：</label>  
                    <input id="testFileInput2" type="file" name="images"                                        
                        uploaderOption="{
                            swf:'<{$Think.const.DWZ_URL}>uploadify/scripts/uploadify.swf',
                            uploader:'__MODULE__/Common/upImg',
                            formData:{authId:<?php echo $_SESSION['authId'];?>, ajax:5},
                            buttonText:'请选择文件',
                            fileSizeLimit:'20000KB',
                            fileTypeDesc:'*.jpg;*.jpeg;*.gif;*.png;',
                            fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;',
                            auto:true,
                            onUploadSuccess:function(file,data,respore){
                                $('#topPhpto').attr('src','<{$Think.const.PUBLIC_URL}>'+'Upload/'+data);
                                $('#image').val(data);
                            }
                        }"
                    />
                </div>
                <div class="unit">
                    <label>俱乐部描述：</label>
                    <textarea name="desc_" rows="5" cols="37" style="resize:none" class=""><{$vo.desc_}></textarea>
                </div>
                <div class="unit">
                    <label>俱乐部英文描述：</label>
                    <textarea name="en_desc_" rows="5" cols="37" style="resize:none" class=""><{$vo.en_desc_}></textarea>
                </div>
            </div>
        <else/>
            <input type='hidden' id='group' name='group_id' value='<{$vo.group_id}>'/>            
            <div class="pageFormContent" layoutH="58">
                <div class="unit">
                    <label>活动主题：</label>
                    <input type="text" name="theme" size="45"  value="<{$vo.theme}>" class='required' />
                </div> 
                <div class="unit">
                    <label>英文主题：</label>
                    <input type="text" name="en_theme" size="45"  value="<{$vo.en_theme}>" class='required' />
                </div>
                <div class="unit">
                    <label>活动内容：</label>
                    <textarea name="content" rows="5" cols="37" style="resize:none" class="required"><{$vo.content}></textarea>
                </div>
                <div class="unit">
                    <label>活动英文内容：</label>
                    <textarea name="en_content" rows="5" cols="37" style="resize:none" class="required"><{$vo.en_content}></textarea>
                </div>
                <div class="unit">
                    <label>活动类型：</label>
                    <input type="radio" name='type' value='1' <if condition="($vo['type'] eq 1) or($vo['type'] eq '') or ($vo['type'] eq '0')">checked</if>>俱乐部活动　
                    <input type="radio" name='type' value='2' <if condition="$vo['type'] eq 2">checked</if>>部门活动
                    <input type="radio" name='type' value='3' <if condition="$vo['type'] eq 3">checked</if>>EVENTS
                </div>
                <div class="unit" id='clubs'>
                    <label>俱乐部：</label>
                    <select style="width: 150px;" id='club_id_'>
                        <foreach name="clubGList" item='cGList'>
                            <option value="<{$cGList['id']}>" <if condition="$cGList['id'] eq $vo['group_id']">selected</if>><{$cGList.name}></option>
                        </foreach>
                    </select>
                </div>
                <div class="unit" id='secs' style="display:none">
                    <label>部门：</label>
                    <select style="width: 150px;" id='sec_id_'>
                        <foreach name="secList" item='secList'>
                            <option value="<{$secList['id']}>" <if condition="$secList['id'] eq $vo['group_id']">selected</if>><{$secList.name}></option>
                        </foreach>
                    </select>
                </div>
                <div class="unit">
                    <label>举行时间：</label>
                    <input type="text" name="validity" size="25"  value="<{$vo.validity}>" class='date' readonly="true"/>
                </div>
            </div>
        </if>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
                <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
            </ul>
        </div>
    </form>	
</div>
<script>
    $(function(){
        $("#group").val($('#club_id_ option:selected').val());
        $('#club_id_').change(function(){
            $("#group").val($('#club_id_ option:selected').val());
        });
        $("input[type='radio']").click(function(){
            if($(this).val()==1){
                $("#clubs").css("display","");
                $("#secs").css("display","none");
                $("#group").val($('#club_id_ option:selected').val());
                $('#club_id_').change(function(){
                    $("#group").val($('#club_id_ option:selected').val());
                });
            }else if($(this).val()==2){
                $("#clubs").css("display","none");
                $("#secs").css("display","");
                $("#group").val($('#sec_id_ option:selected').val());
                $('#sec_id_').change(function(){
                    $("#group").val($('#sec_id_ option:selected').val());
                });
            }else{
                $("#clubs").css("display","none");
                $("#secs").css("display","none");
                $("#group").val('');
            }
       }) ;
    });

</script>
